package com.dongway.netcondition.socketToBox;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {

    public static void startServer() throws IOException, InterruptedException {
        @SuppressWarnings("resource")
        ServerSocket serverSocket = new ServerSocket(12009);
        Socket socket = null;
        while (true) {
            socket = serverSocket.accept();
            Runnable threadSocket = new ThreadSocket(socket);
            Thread thread = new Thread(threadSocket);
            thread.start();

        }

    }

}
